UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U00oksXO1fF1BTv6N7lx/TMBz+hZIOIAN0NozPMYwvk=' 
WHERE 
  key_id = '9fcb77e83aa6edd1e4c27c6b81367a51a844761312dee7652daeb7cfee0d8621' 
  AND (
    token = 'U00oksXO1fF1BTv6N7lx/TMBz+hZIOIAN0NozPMYwvk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029