UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QlmDvSF5IB8dPWo7jiVHFwX47QQpS6QDQpyjULcQayE=' 
WHERE 
  key_id = 'fc6ed02d107cfdba6ad3f65b1e9b8dfcba6bdd02a819aa6759cbdd805498679c' 
  AND (
    token = 'QlmDvSF5IB8dPWo7jiVHFwX47QQpS6QDQpyjULcQayE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037