UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Kwt0OUGOcWF4J6zFiNrluKFiW+vV2QNqXWg9nOGNr4=' 
WHERE 
  key_id = '184d4da741a955030605c919e8419f3f7534c899884a00a300ddaba5813d8363' 
  AND (
    token = '9Kwt0OUGOcWF4J6zFiNrluKFiW+vV2QNqXWg9nOGNr4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017