UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KYOt/lqJxN8EWgeOD9AZBdOhAA/VjnSKvFb7/YyJsK4='
WHERE
key_id = 'ac6b8c8f5035ee4e2ec330b4001da8124f4481a144e1e58cd8f1058719b106fb'
AND (
token = 'KYOt/lqJxN8EWgeOD9AZBdOhAA/VjnSKvFb7/YyJsK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)