UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'feCSIM2TMfzYAc2cOguYR3IjDr4QMhU79CmCSg3E4iI=' 
WHERE 
  key_id = '1aba7f26359eea5260cae63f566bba0e861279946fdf1b721b3d798a6be3dbb8' 
  AND (
    token = 'feCSIM2TMfzYAc2cOguYR3IjDr4QMhU79CmCSg3E4iI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026