UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'donW0P6/Uj/QE+uo3LFIxWrgB9jUteMTFYPvb1tgTVI=' 
WHERE 
  key_id = '005b7de6e7dd9b68470075234c9a2d8235134da0a3f22b6a8e27f1ea6e54c1a2' 
  AND (
    token = 'donW0P6/Uj/QE+uo3LFIxWrgB9jUteMTFYPvb1tgTVI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030