UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LFlGwmSlzNj25Sg7TB8sVT4w9fe5Hr6prYU6VEPfE/0=' 
WHERE 
  key_id = '1e48247ee8eccc84ec8c4530b12004320f046dc3c90cd3c1a14229f250c71c86' 
  AND (
    token = 'LFlGwmSlzNj25Sg7TB8sVT4w9fe5Hr6prYU6VEPfE/0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026