UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '66xe+nnG1Pl/FQEae88BtH/V7aLvpJvTljbB/CqW4so=' 
WHERE 
  key_id = '64422f7770467a35ea7870da628df6dc73c62b176fb4848f2bc79b985f604c3b' 
  AND (
    token = '66xe+nnG1Pl/FQEae88BtH/V7aLvpJvTljbB/CqW4so=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018