UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dkBHaQdNpWjl5kX51/HCVFJsrIp25TQB58xHnYO8dLw=' 
WHERE 
  key_id = '1b2ea55d0001f94752b8a336720224ce88f2adbaee77bdc0db7f17f1d7211dcc' 
  AND (
    token = 'dkBHaQdNpWjl5kX51/HCVFJsrIp25TQB58xHnYO8dLw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023