UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5h87vejHkEKXDkoCpqn/ZXDD4b8yyB/+dI8BKhCJCbM='
WHERE
key_id = '50df5a8da8b17b5e5292c7c8041fc70aa6b665a47ae04ce18f420782dc3cabbb'
AND (
token = '5h87vejHkEKXDkoCpqn/ZXDD4b8yyB/+dI8BKhCJCbM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)