UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HVt0f8FgaBntVXhmv+bD4zA36ZuNAAcnyxMyrGVTm6g='
WHERE
key_id = '4d3ff0a4ec620e2c4c25f5c259ec79d1c9f156fe9a4e70e435abae17bdfcf7c8'
AND (
token = 'HVt0f8FgaBntVXhmv+bD4zA36ZuNAAcnyxMyrGVTm6g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)