UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J9Ytgt0LvdAeleNesK4mVvd3k0/UZqM2xiamUOefhBg=' 
WHERE 
  key_id = '1b3d0d7e9a5c2adb73ec063263f0514136d5b3efe2aa8d4fe3fa22f4eb53db1e' 
  AND (
    token = 'J9Ytgt0LvdAeleNesK4mVvd3k0/UZqM2xiamUOefhBg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044