UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GLli+y7OQGuwkzGuENltCLI30JNAbNXcWnqAjIMlsdE='
WHERE
key_id = '667ba47c834355ca8f37128f8296e52ec1677723827e914625245e9d4525d494'
AND (
token = 'GLli+y7OQGuwkzGuENltCLI30JNAbNXcWnqAjIMlsdE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)