UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XM9NYcQAZQ7noMDFt5efjkcGwPNxrrBYznBCsJFEZZA='
WHERE
key_id = '70fe6008791ea5452474c71f5888add135476b4bfe5b600ef71a7b4f33870831'
AND (
token = 'XM9NYcQAZQ7noMDFt5efjkcGwPNxrrBYznBCsJFEZZA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)