UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TjgSxIZ4gBeZi4Gm5ZrBIxEWRE0oex0EpPMI2Q64jy0=' 
WHERE 
  key_id = '3c4f3de38e34b0de15ba0a547542ad86f8f77c397af436165c0cdb549b0df7e5' 
  AND (
    token = 'TjgSxIZ4gBeZi4Gm5ZrBIxEWRE0oex0EpPMI2Q64jy0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027