UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zvljg/WhLBd8L+GiGe9ExRM2IBjoAztda7xma2Ylss8=' 
WHERE 
  key_id = '72a0203eabc1bb3c4a128923f1047b4b99cca4ba072ccfeb322777d03a3a9f91' 
  AND (
    token = 'zvljg/WhLBd8L+GiGe9ExRM2IBjoAztda7xma2Ylss8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032