UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DDFEtEmiaxYxs6gcqmsDqOZZBwLS1FZddF5lMTfheS8='
WHERE
key_id = 'c83b08a6595aea59183a9a65899b358179a98958dc421ea10eb22d5985982bfb'
AND (
token = 'DDFEtEmiaxYxs6gcqmsDqOZZBwLS1FZddF5lMTfheS8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)