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