UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1asP0F6lIZ0E0Mo/JnY7Omuqj6NdZUNmyzY8tie2b0k=' 
WHERE 
  key_id = '472a42d321f276f0ddfd7419a82be926ff00dbee08e915aeacced82b2f31adbd' 
  AND (
    token = '1asP0F6lIZ0E0Mo/JnY7Omuqj6NdZUNmyzY8tie2b0k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018