UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JPl36xrxjfTB5dgz0opBokj93FvuBd6R6UbL85onwPY=' 
WHERE 
  key_id = '979b025b884c7703c296ae2ed53e3cfcaca37c92cd0f0069624ff2317865fcad' 
  AND (
    token = 'JPl36xrxjfTB5dgz0opBokj93FvuBd6R6UbL85onwPY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050