UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6sGWgm+QVT/0hE/JaW4t1wgfHRzwKx/Hd8qktPqM5DA='
WHERE
key_id = 'd834631b13c1c1d61312e5e31c7c7c9bfb2d84e60225289c9b190e4a805f4fce'
AND (
token = '6sGWgm+QVT/0hE/JaW4t1wgfHRzwKx/Hd8qktPqM5DA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)