UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/+ZMSfS59Vkdv1baUu12ygayoo636Ylir7pWtjQYXM8=' 
WHERE 
  key_id = '83e7d755e6a6776a3cd096070eda3c815d16560443b52d86bdd787d31416fa38' 
  AND (
    token = '/+ZMSfS59Vkdv1baUu12ygayoo636Ylir7pWtjQYXM8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027