UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UDMj5PbYvuS6GNrj+aaAbXQJIfkbQpoMGh+yQFIMzaA=' 
WHERE 
  key_id = '16571712acd1941e92de327530103cb2628e77813bd32c91e2536a047d8a7df2' 
  AND (
    token = 'UDMj5PbYvuS6GNrj+aaAbXQJIfkbQpoMGh+yQFIMzaA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035