UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Sb3ZmFJ5wlnyvvcqFe2wHXInwfw3nJQQR0BVsWQ8po=' 
WHERE 
  key_id = 'b6ca1fd3646f65221e71f912bd0cb3b716d2954cfe52163aa4a2a4caf38641f7' 
  AND (
    token = '3Sb3ZmFJ5wlnyvvcqFe2wHXInwfw3nJQQR0BVsWQ8po=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026