UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yQFvsU9N0F7Ew7QLptgNJPG7lC9v4y626f7UxVDJdkU=' 
WHERE 
  key_id = 'd4b81ef23472ff2d7819aab9a12139f28c8bccf3c1b058a144ebc12bc12ac276' 
  AND (
    token = 'yQFvsU9N0F7Ew7QLptgNJPG7lC9v4y626f7UxVDJdkU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022