UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bfM/TT3Rv7h50KgPuIKUJRh6Lmdi1eePZeu1TIZu2lg=' 
WHERE 
  key_id = '4db06e8e2850c1e9f5728f7bb369a9f24056f980529c74c9ad3fedb3702761cd' 
  AND (
    token = 'bfM/TT3Rv7h50KgPuIKUJRh6Lmdi1eePZeu1TIZu2lg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021