UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fUinEWbbae11lG/wMI2eFi0z9KHe71X6q2rCY5O3tZo=' 
WHERE 
  key_id = '14a3c865e4c960faf91d6e7d7f55761e9b9f09cc8878e7657c4dadc254b86fd9' 
  AND (
    token = 'fUinEWbbae11lG/wMI2eFi0z9KHe71X6q2rCY5O3tZo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046