UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4gN604Yre72bfcx4hDh4djKun8e9gC0MhLHjpjusx5k=' 
WHERE 
  key_id = '53f5905c0ef3e9697e2633d0086fce9537dc1ea73519f81887bb30faaf7c7b4d' 
  AND (
    token = '4gN604Yre72bfcx4hDh4djKun8e9gC0MhLHjpjusx5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037