UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h8Yvb7rg2yXmDP8Y05DuPOPPY5h2UVs2h4rpe6i2II4='
WHERE
key_id = '672bb5e42bd9d551e2794ec72b856573f10d8adf4656d7b7c558e9a4f5ad9e91'
AND (
token = 'h8Yvb7rg2yXmDP8Y05DuPOPPY5h2UVs2h4rpe6i2II4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)