UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ofYDoklKuTz4w+tze0sEky4+3TaoIbczsl9xvo0RtFw=' 
WHERE 
  key_id = '44cc6faaf1c9fa259ed47466bf9a1da59ddfd303b2210a60218eadc85d59116e' 
  AND (
    token = 'ofYDoklKuTz4w+tze0sEky4+3TaoIbczsl9xvo0RtFw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027