UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ioYLXpmJ7eCJ/IJixkDVh7eziDXEvYobFmLDgzMgDL4='
WHERE
key_id = '373c5d7591debbfc644b551b5725568c7a0d08c4e8f471366e645f3b98a3a302'
AND (
token = 'ioYLXpmJ7eCJ/IJixkDVh7eziDXEvYobFmLDgzMgDL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)