UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UEb6jLiiuv3gxnYADjYs0TKft499UVaesIzFZumMvNo='
WHERE
key_id = '7fcc1cf047a3630e53ce2d3f6f09e57061b301ebfbb65b9570f2ea5dc50bafff'
AND (
token = 'UEb6jLiiuv3gxnYADjYs0TKft499UVaesIzFZumMvNo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)