UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5ixHUOMZlVgFcNAh1GIuxg/LnXyb6goMtLRtdAd4XI0=' 
WHERE 
  key_id = '77fdd60e68b330fb998dccc75a47e1837c92de83fcac1b62dd943331bf778a51' 
  AND (
    token = '5ixHUOMZlVgFcNAh1GIuxg/LnXyb6goMtLRtdAd4XI0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022