UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TigHTbXeAPzQKarO4HxGpKiaSF4BXJyJFeiqC7G/P40='
WHERE
key_id = '52816acfe816b1f2d1bfa1c59af64bb28d8a8ecf8e9a2c279e7b4837686b3562'
AND (
token = 'TigHTbXeAPzQKarO4HxGpKiaSF4BXJyJFeiqC7G/P40='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)