UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7j52Ztajv1/9BJih0uZpEyz4/WtTvSKtUd29vEBALIg=' 
WHERE 
  key_id = 'c6b0d3a96169cc05aed988694577d31686741c8e76715e3e75d9fb8e75266f53' 
  AND (
    token = '7j52Ztajv1/9BJih0uZpEyz4/WtTvSKtUd29vEBALIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024