UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zzI1HnQ6lmLWlgYXr88qygOPB00SxN+wm3P8kU1ZEbY=' 
WHERE 
  key_id = '1c1b0417ba1381699ddfccecd58d1c79bed6f34f7a64cd95b6b9e146c77e44a7' 
  AND (
    token = 'zzI1HnQ6lmLWlgYXr88qygOPB00SxN+wm3P8kU1ZEbY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016