UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hc2iXTfpspuh//bDAwCawMmIyeCkEhsLbGIo8fyh8sg=' 
WHERE 
  key_id = '1e97dc3cb7314250c88887fac94bba72a93d06ac9c47fc667538e25867b4d106' 
  AND (
    token = 'hc2iXTfpspuh//bDAwCawMmIyeCkEhsLbGIo8fyh8sg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030