UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2sAv6VifNrHerr5TQMs2oGS5P1UxKcAjKiwzA/Jjog4=' 
WHERE 
  key_id = '279956fd8721c50481a5faa9f68614910d3c1b0d6a763ced5564adeedf35a848' 
  AND (
    token = '2sAv6VifNrHerr5TQMs2oGS5P1UxKcAjKiwzA/Jjog4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027