UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GNmkgIgDAStzp0A9a84roz+sYqjf+8YM4h5wn1i0GWk='
WHERE
key_id = '824acbba7d2a721db2d06323372f19b0fe9c414cfa3f5d42dc12f4f0f26b37df'
AND (
token = 'GNmkgIgDAStzp0A9a84roz+sYqjf+8YM4h5wn1i0GWk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)