UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fx4F03YPsh9oENJbVR3JVoQFyGKn+Q80KjgIsrC8WNA=' 
WHERE 
  key_id = '57c9ae780ed2ddd317d78be611b9b013f43bc6ad3eb50bf735eecfd00c44ede6' 
  AND (
    token = 'Fx4F03YPsh9oENJbVR3JVoQFyGKn+Q80KjgIsrC8WNA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00185