UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e9yQLojOLG3xnwTzrWc+bHj+JlHS71RaIK3R0wGFkhM=' 
WHERE 
  key_id = '929f2af02d167b2e87f391992e2a805c326d2d77f4ddbf45d57aa36e8e6a595a' 
  AND (
    token = 'e9yQLojOLG3xnwTzrWc+bHj+JlHS71RaIK3R0wGFkhM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034