UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dbk2tJPE/jIruw97hWJh309GtDXQLm+vaMKQd6HJ4F4=' 
WHERE 
  key_id = '01ff388adcb7ed1379ff67d352f79937644ceb520511178d7073f10eea361d4f' 
  AND (
    token = 'dbk2tJPE/jIruw97hWJh309GtDXQLm+vaMKQd6HJ4F4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00077