UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RduOE/uFX7buC9prh/NQ9Dz1J3awQczPs+fzzJ9AZL4=' 
WHERE 
  key_id = '0fcff0724aaad8a4b251cc1ae3bd9fec88ffc6718c4ad929501e0fdc73b6a614' 
  AND (
    token = 'RduOE/uFX7buC9prh/NQ9Dz1J3awQczPs+fzzJ9AZL4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034