UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0OFwIGOs1xLIKX0nr7NHBrCkCbRGUGPnkyHDGSrukPQ=' 
WHERE 
  key_id = '10f08c60b68a9652bed4a185a512d026fcf5ceec40c7851d75bd1f2151c1b1f8' 
  AND (
    token = '0OFwIGOs1xLIKX0nr7NHBrCkCbRGUGPnkyHDGSrukPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061