UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qJOf66uEgH79Fv1azJnjePpmAokK1N4IAeBYeJtYANA=' 
WHERE 
  key_id = '6e352752de50c7ea25b7d028b081a6e6c38291ff09af31e323a33d606009c372' 
  AND (
    token = 'qJOf66uEgH79Fv1azJnjePpmAokK1N4IAeBYeJtYANA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033