UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zS5RYjErFyIGIh2CV4FGVaueqT9VH1+mZU1QBsyF5wU=' 
WHERE 
  key_id = '09d710c252a6a7ac9a9d2a65ed317449fc03ebdaaf5bf076f7652f10f6cc4523' 
  AND (
    token = 'zS5RYjErFyIGIh2CV4FGVaueqT9VH1+mZU1QBsyF5wU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032