UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cZ1C/ld1aigLROdSsdF62XdOG+rQdUnG6ehbfR4+/+0=' 
WHERE 
  key_id = '03c08e49a8d6799d287b7a4b7181a4df414768f541b7b5a92a483151ac79f8c6' 
  AND (
    token = 'cZ1C/ld1aigLROdSsdF62XdOG+rQdUnG6ehbfR4+/+0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033