UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DNqmrV8T8BeXU/bZasUM1fwAHHNNTS23WZW4IVI0aVE='
WHERE
key_id = 'fc612f38cb4dd6fa31bc0dfe103b3bcec00b11e358091aabb0f6da3f09789636'
AND (
token = 'DNqmrV8T8BeXU/bZasUM1fwAHHNNTS23WZW4IVI0aVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)