UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KCcvuq/ew5HwH67vYo7QSzoNVOU6pChOhYeqNDpOKso=' 
WHERE 
  key_id = '082b8c55ab7823b2c39ce679eef3fc4fa0df601a6fd9eea28b290cbda0a07939' 
  AND (
    token = 'KCcvuq/ew5HwH67vYo7QSzoNVOU6pChOhYeqNDpOKso=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029