UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wkgUZl+TJyWcEYHWRWkWjg7HOMnczdqlKvZgmki4oDw=' 
WHERE 
  key_id = '7f0d556b6b560a41efd50095d43157d024f732f635aba37347aac26aa98ec8c7' 
  AND (
    token = 'wkgUZl+TJyWcEYHWRWkWjg7HOMnczdqlKvZgmki4oDw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028