UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HBrql9J3dF1GJerSasdQChV2rYZi6F1wyLmQd3cHftw=' 
WHERE 
  key_id = '873649e32aff4a7217330c6dc3dc82648586ae81f663cc94b3910d0a7418c9b2' 
  AND (
    token = 'HBrql9J3dF1GJerSasdQChV2rYZi6F1wyLmQd3cHftw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018