UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z5Wp1bNDKtJXYsvmyjSlGw/xDeun2Fq6Qcx4ocm0R8c=' 
WHERE 
  key_id = 'bc0a5e981dd21a0134588e773b3b12c746f5fbc0771d708a45ab9d17d16fdc6f' 
  AND (
    token = 'Z5Wp1bNDKtJXYsvmyjSlGw/xDeun2Fq6Qcx4ocm0R8c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033