UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd2qbjdtZJwK++/AMP6w9kdhdi04INjT7NUIGu/sX9tc=' 
WHERE 
  key_id = '96edf93ea0010f8b3fe6a47ea6d2feac2ace0e5cf5a3ab3c95a96d1f71c645d0' 
  AND (
    token = 'd2qbjdtZJwK++/AMP6w9kdhdi04INjT7NUIGu/sX9tc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028