UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CmPK1le3dQeTKRy461CLfkC+AM+mymp7Fb4GuDZmnjc='
WHERE
key_id = '677576f61197c9ce79f7f79ae8ac92b0d2af48244b0ea016e688006208239e5f'
AND (
token = 'CmPK1le3dQeTKRy461CLfkC+AM+mymp7Fb4GuDZmnjc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)