UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wwwIs4iKWwBkTzwDv9t1wlpybLqnqXh3jtv/41r//FU='
WHERE
key_id = 'b339985a18d57290a585834c190c8a587e956d376d267b411168188356935ee9'
AND (
token = 'wwwIs4iKWwBkTzwDv9t1wlpybLqnqXh3jtv/41r//FU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)