UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2+I7ZyS/BzLcWJBCkxJYbFsWo14mAstrhDtbQiHQyKA=' 
WHERE 
  key_id = 'ad02275682861fb0d973ced060023e2c93a33291e59cf127d5e12dff6eb8e7ed' 
  AND (
    token = '2+I7ZyS/BzLcWJBCkxJYbFsWo14mAstrhDtbQiHQyKA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037