UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BkEzmv/iGz2SJlmnrA5HSE+T5vB3OvX1kfqTUNFIb9I=' 
WHERE 
  key_id = 'f5a8f2c635945f1acb306ceb96c95008286cd0897463a0dc3132f2c1c74e7c4e' 
  AND (
    token = 'BkEzmv/iGz2SJlmnrA5HSE+T5vB3OvX1kfqTUNFIb9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00082