UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DEWWUDfi/ImC6Z0ifINOkzodRB3lGfak5nx7E1WN5pY=' 
WHERE 
  key_id = '541c66880ca9dbb7cfb4f39bd562cf7ea31ba78335744e55c01639a2c937e71b' 
  AND (
    token = 'DEWWUDfi/ImC6Z0ifINOkzodRB3lGfak5nx7E1WN5pY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022