UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'owTE5KtauGs2vfkSOMs+kxMOr4h0aC3k0NMM5wUUPlo=' 
WHERE 
  key_id = '34c5bc7767c36f748c9017645270d8bd33313b4e3cc6f2aa682b8fbba124ff7e' 
  AND (
    token = 'owTE5KtauGs2vfkSOMs+kxMOr4h0aC3k0NMM5wUUPlo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00065