UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LdsxNtKaEhUlD5NwEYNhI0VnPG0a7XNO6/nZBdXxVFE='
WHERE
key_id = 'bfb4096824d6a44efda5c52ad6145478f71709e06f9827ad3f79218046912d72'
AND (
token = 'LdsxNtKaEhUlD5NwEYNhI0VnPG0a7XNO6/nZBdXxVFE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)